//***************************************************************************
//*
//*	File:			dswl_projects.h
//*	Description:	Wrapper for IProjects interface
//*
//***************************************************************************
//*
//*	Note:			This source code is provided "as is" meaning that you may 
//*					use it at your own risk. 
//*					You are free to use it in any way you like.
//*
//***************************************************************************
//*
//*	History:		
//*
//*	-------------------------------------------------------------------------
//*	2003/07/27	|	Initial release									|	rk
//*	-------------------------------------------------------------------------
//*
//***************************************************************************

//
//-------------------------------------------------------------- PREPROCESSOR 
//

#ifndef			_DSWL_PROJECTS_H_INCLUDED
#define			_DSWL_PROJECTS_H_INCLUDED

#if				_MSC_VER > 1000
#pragma once
#ifdef			__SWITCH_SHOW_HEADER
#pragma message ("-- dswl_projects.h\n")
#endif
#ifdef			__SWITCH_SHOW_HEADER_TREE
#pragma message ("-- "__FILE__"\n")
#endif
#endif 

#ifdef			_DSWL_SWITCH_USE_AUTOCAST
#ifdef			_DSWL_SWITCH_USE_UNSAFE_AUTOCAST
#pragma	message ( "-- dswl_projects.h \t Warning: Generating auto-cast operator: CIProjects::operator IProjects* () const" )
#else
#pragma	message ( "-- dswl_projects.h \t Warning: Generating auto-cast operator: CIProjects::operator       IProjects* ()" )
#pragma	message ( "-- dswl_projects.h \t Warning: Generating auto-cast operator: CIProjects::operator const IProjects* () const" )
#endif
#endif

//
//-------------------------------------------------------------- DEPENDENCIES
//

//
//------------------------------------------------------ FORWARD DECLARATIONS
//

class			CIApplication	;
class			CIGenericProject;

//
//--------------------------------------------------------- CLASS DECLARATION
//

//***************************************************************************
//**	@DOC		CLASS CIProjects
//***************************************************************************
//*		@CLASS		Wrapper for IProjects interface
//***************************************************************************
class _DSWL_EXT_CLASS CIProjects  
{
	//																								
	//-----------------------------------------------------------------------						
	//***************************     ATTRIBS     ***************************						
	//-----------------------------------------------------------------------						
	//																								
private:																									// @ACCESS	Private Attributes	
			CComPtr< IProjects >	m_pIProjects	;														// @CMEMBER	Smart pointer to the actual text project interface
																										
	//																													
	//-----------------------------------------------------------------------											
	//*************************     PROPERTIES     **************************					
	//-----------------------------------------------------------------------											
	//																													
public:																										// @ACCESS	Public Property Methods
			CIApplication			GetApplication		( void )								const	;	// @CMEMBER	Returns the application the projects belong to
			long					GetCount			( void )								const	;	// @CMEMBER	Returns the number of projects in the container

	//																												
	//-----------------------------------------------------------------------										
	//*************************     INFORMATION     *************************					
	//-----------------------------------------------------------------------										
	//																												
public:																										// @ACCESS	Public Information Methods
			BOOL					IsNull				( void )								const	;	// @CMEMBER	Determines whether the internal pointer is <t NULL>
			BOOL					IsValid				( void )								const	;	// @CMEMBER	Determines whether the internal pointer differs from <t NULL>
																								
	//																										
	//-----------------------------------------------------------------------								
	//*********************     ELEMENT MANAGEMENT     **********************
	//-----------------------------------------------------------------------								
	//																										
public:																										// @ACCESS	Public Project Management Methods
			CIGenericProject		GetAt				(		long			a_lIndex	)	const	;	// @CMEMBER	Determines the item at specified 0-based index. 
			CIGenericProject		GetItem				(		long			a_lItem		)	const	;	// @CMEMBER	Determines the item at specified 1-based index. 

	//																								
	//-----------------------------------------------------------------------						
	//**************************     OPERATORS     **************************						
	//-----------------------------------------------------------------------						
	//																								
public:																										// @ACCESS	Public Operators
			bool					operator	==		( const CIProjects&		a_Other		)	const	;	// @CMEMBER	Comparison operator
			bool					operator	!=		( const CIProjects&		a_Other		)	const	;	// @CMEMBER	Comparison operator
			bool					operator	<=		( const CIProjects&		a_Other		)	const	;	// @CMEMBER	Comparison operator
			bool					operator	>=		( const CIProjects&		a_Other		)	const	;	// @CMEMBER	Comparison operator
			bool					operator	<		( const CIProjects&		a_Other		)	const	;	// @CMEMBER	Comparison operator
			bool					operator	>		( const CIProjects&		a_Other		)	const	;	// @CMEMBER	Comparison operator
																							
			CIProjects&				operator	=		(		IProjects*		a_pIOther	)			;	// @CMEMBER	Copy operator
																							
			IProjects*				operator	*		( void )										;	// @CMEMBER	Dereference operator
	const	IProjects*				operator	*		( void )								const	;	// @CMEMBER	Dereference operator
																								
			IProjects*				operator	->		( void )										;	// @CMEMBER	Member access operator
	const	IProjects*				operator	->		( void )								const	;	// @CMEMBER	Member access operator

			CIGenericProject		operator	[]		(		int				a_iIndex	)	const	;	// @CMEMBER	Subscription operator
																							
	#ifdef	_DSWL_SWITCH_USE_AUTOCAST														
	#ifdef	_DSWL_SWITCH_USE_UNSAFE_AUTOCAST												
									operator			IProjects*	( void )					const	;	// @CMEMBER	TypeCast operator
	#else																						
									operator			IProjects*	( void )							;	// @CMEMBER	TypeCast operator
									operator	const	IProjects*	( void )					const	;	// @CMEMBER	TypeCast operator
	#endif																					
	#endif							
									
	//																						
	//-----------------------------------------------------------------------				
	//***********************     CON/DESTRUCTION     ***********************				
	//-----------------------------------------------------------------------				
	//																						
public:																										// @ACCESS	Public Con-/Destruction Methods	
			 CIProjects( IProjects* a_pIProjects = NULL );													// @CMEMBER	Default constructor
	virtual ~CIProjects();																					// @CMEMBER	Default destructor
};
//***************************************************************************
//**	@END
//***************************************************************************

#endif		// _DSWL_PROJECTS_H_INCLUDED
